# @LICENSE(NICTA_CORE) 

# Targets
TARGETS := liblwip.a

# Source files required to build the target
CFILES := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/inet.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/ipv4/icmp.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/ipv4/ip.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/ipv4/ip_addr.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/mem.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/memp.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/netif.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/pbuf.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/stats.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/sys.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/tcp.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/tcp_input.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/tcp_output.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/tcp_pcb.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/core/udp.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/netif/etharp.c)) \
	$(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/sos/sosif.c))

# Header files/directories this library provides
# We also need to include the lwip headers as we have
# Circular dependency with the includes
#HDRFILES := $(wildcard $(SOURCE_DIR)/include/*)
RHDRFILES := '$(wildcard $(SOURCE_DIR)/include/lwip/*) lwip' \
	'$(wildcard $(SOURCE_DIR)/include/arch/*) arch' \
	'$(wildcard $(SOURCE_DIR)/include/ipv4/*) ipv4' \
	'$(wildcard $(SOURCE_DIR)/include/netif/*) netif' \
	'$(wildcard $(SOURCE_DIR)/include/netif/*) lwip/netif' \
	'$(SOURCE_DIR)/include/lwipopts.h lwip' \
	'$(wildcard $(SOURCE_DIR)/include/arch/*) lwip/arch' \
	'$(wildcard $(SOURCE_DIR)/include/ipv4/lwip/*) lwip'
	

CFLAGS := -g -O0 -DNO_INLINE_APIS -w
include $(SEL4_COMMON)/common.mk
